<template>
  <div class="home">
    <div id="main"></div>
  </div>
</template>

<script>
import * as echarts from "echarts"
export default {
  name: 'Home',
  methods:{
    getArt(){
        const myChart = echarts.init(document.getElementById('main'));
        myChart.setOption({
          title: {
              text: '访客记录'
          },
          tooltip: {
            // data: ['未知', '17岁以下', '18-24岁', '25-29岁', '30-39岁', '40-49岁','50岁以上']
          },
          xAxis: {
              data: ['未知', '17岁以下', '18-24岁', '25-29岁', '30-39岁', '40-49岁','50岁以上']
          },
          yAxis: {},
          series: [{
              // name: '访客',
              type: 'bar',
              data: [2,2,20,24,28,14,6]
          }]
      });
    }
  },
  mounted(){
    this.getArt()
  }
}
</script>
<style scoped>
  #main{
    width: 1000px;
    height: 600px;
    border: 1px solid #000;
  }
</style>
